using System;
using System.Collections.Generic;
using System.Drawing;

namespace Nate.Pathfinding
{
    public class Edge : IComparable<Edge> 
    {
        public int      Index        { get {return _index;} }
        public int      A            { get {return _a;}     }
        public int      B            { get {return _b;}     }
        public double   Cost         { get {return _cost;}  }

        public Edge(int index, int a, int b, double cost)
        {
            _index = index;
            _a = a;
            _b = b;
            _cost = cost;
        }

        public int Other(int i)
        {
            return i == A ? B : A;
        }

        public int CompareTo(Edge other)
        {
            return Cost.CompareTo(other.Cost);
        }

        private int _index;
        private int _a;
        private int _b;
        private double _cost;
    }
}
